package org.ala.tiktools.sharddb.mybatis.summary.impls;

import org.ala.tiktools.sharddb.mybatis.router.ShardInfo;
import org.ala.tiktools.sharddb.mybatis.summary.IShardSummary;

import java.util.Map;


/**
 * 求和结果sum
 *
 * @author ala
 * @date 2025-02-21 12:28
 */
public class ShardSumSummary implements IShardSummary<Integer> {


    @Override
    public Integer summary(Map<ShardInfo, Integer> result) {
        return result.entrySet().stream().mapToInt(e -> e.getValue().intValue()).sum();
    }
}
